/* Version 0.01 2012.06.27  */

#include "displayable.h"


Displayable::Displayable(float _x, float _y, int _w, int _h)
:x(_x), y(_y), w(_w), h(_h), bCanDrag(FALSE), bCheck(FALSE), bClick(FALSE)
{

}

void Displayable::draw(HDC hdc)
{
	Rectangle(hdc, x, y, x+w, y+h);
}

int Displayable::beClicked()
{
	return TYPE_BASE;
}

bool Displayable::isInArea(int mx, int my)
{
	return mx > x && my > y && mx < x+w && my < y+h;
}

bool Displayable::needCheck()
{
	return bCheck;
}

bool Displayable::canClick()
{
	return bClick;
}

float Displayable::getX()
{
	return x;
}

float Displayable::getY()
{
	return y;
}

void Displayable::setPos(float _x, float _y)
{
	x=_x; y=_y;
}